var vm = new Vue({
        el: '#app',
        data: {
            host: HOST,
            text: ''
        },
        mounted: function () {
            this.shou_head();
            // this.pinglun()
        },
        methods: {
            shou_head: function () {
                axios.get(this.host + '/spitslot/', {
                    responseType: 'json'
                })
                    .then(response => {
                        this.text = response.data
                        console.log(response,"1")
                    })
                    .catch(error => {

                    })
            },
            pinglun: function () {
                axios.post(this.host+'/comment_view/', {
                        user_id: "1",
                        content: "sdfsd",
                        Tsukkomi_id:"1"
                    }, {
                        responseType: 'json',
                        withCredentials: true,
                    })
                    .then(response => {
                        this.text = response.data
                        console.log(response)
                    })
                    .catch(error => {

                    })


            }
        },
        filters: {
            capitalize: function (value) {
                value = value.replace(/<[^>]+>/g,"");
                value = value.replace(/&nbsp;/g,"")
                if (value.length>=150){
                    return value.substring(0, 150)+"    ..."
                }
                else {
                    return value
                }
            },
            getTitleHref: function (herf) {
                return "./spit-detail.html?id=" + herf
            }
        }
    })
;